package com.r.pan.entity.dto;

import com.r.pan.constant.Constants;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 注册表单DTO类
 */
@Data
public class RegisterFormDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 注册邮箱
     */
    @NotEmpty(message = Constants.INVALID__EMAIL)
    @Pattern(regexp = Constants.REGEX__EMAIL, message = Constants.INVALID__EMAIL)
    private String email;

    /**
     * 用户名
     */
    @NotEmpty(message = Constants.INVALID__USERNAME)
    @Pattern(regexp = Constants.REGEX__USERNAME, message = Constants.INVALID__USERNAME)
    private String username;

    /**
     * 明文密码
     */
    @NotEmpty(message = Constants.INVALID__PASSWORD)
    @Pattern(regexp = Constants.REGEX__PASSWORD, message = Constants.INVALID__PASSWORD)
    private String password;

    /**
     * 邮箱验证码
     */
    @NotEmpty(message = Constants.INVALID__EMAIL_CODE)
    private String emailCode;

    /**
     * 图片验证码
     */
    @NotEmpty(message = Constants.INVALID__IMAGE_CODE)
    private String imageCode;
}
